package com.example.administrator.caigou51.global;

import java.util.HashMap;

public class Constant {

    /**
     * 系统环境配置常量
     */
    public static class SystemContext {

        public static final boolean isChooseService = false;// 调试模式，发版要改false
        public static final boolean isDebugLog = false;// 是否打印日志 测试阶段 无论是否打包 最好都打开/
        public static boolean isDebugShowToast = false;// 是否打印日志

        public static final String encodeStyle = "UTF-8";
        public static final String SuccessState = "200"; // 请求成功

//http://www.51caiyao.com/api/index.php?app=xxx&act=xxx
   //     public static final String ROOT_URL_VALUE = "http://192.168.70.6/api/index.php?"; // 测试服务器
        public static final String ROOT_URL_VALUE = "http://www.51caiyao.com/api/index.php?"; // 上线服务器
        public static final String IMAGE_BASE_URL = "http://yao.kzj365.com/";

        public static String WXID ="wx8360858911f6cc85";
        public static String shareText= "51采药网，医药人自己的慢病药品采销平台，让药品采购跟淘宝一样简单！";
    }

    /**
     * 系统环境配置常量
     */
    public static class Action {

        public static final String TokenAct_MainData = "group";
        public static final String Action_MainData = "app=group&act=index_page";//首页数据
        public static final String Action_SearchGoods = "app=goods&act=search";//搜索列表
        public static final String Action_HotSearch = "app=goods&act=keywords";//热门搜索
        public static final String Action_Category = "app=category&act=cat_list";//分类列表
        public static final String Action_GoodsDetail = "app=goods&act=goods_info";//商品详情
        public static final String Action_GoodsSay = "app=goods&act=specification";//商品说明
        public static final String Action_TradeRecord = "app=goods&act=order_list";//交易记录
        public static final String Action_RelatedGoods = "app=goods&act=related_goods";//关联商品
        public static final String Action_ZhuanQuXiangQing = "app=category&act=prefecture_info";//专区详情
        public static final String Action_Login = "app=user&act=login";//登录
        public static final String Action_GetYanZhengMa = "app=sms&act=get_code";//获取验证码
        public static final String Action_Register = "app=user&act=register";//注册
        public static final String Action_ChehckYanZheng = "app=sms&act=verify_code";//验证短信验证码
        public static final String Action_PassReset = "app=user&act=password_reset";//修改密码
        public static final String Action_MessageList = "app=message&act=latests";//最新消息列表
        public static final String Action_MessageDetailList = "app=message&act=list";//消息详情列表
        public static final String Action_SetMessageRed = "app=message&act=set_read";//消息已读
        public static final String Action_RegionList = "app=region&act=list";//获取地区列表
        public static final String Action_SumitZhiZhi = "app=shop&act=add_qualification";//提交资质
        public static final String Action_EditZhiZhi = "app=shop&act=edit_qualification";//修改资质
        public static final String Action_AddCar = "app=cart&act=add_to_cart";//加入购物车
        public static final String Action_GetCarList = "app=cart&act=cart_list";//购物车列表
        public static final String Action_UpdateCarList = "app=cart&act=update_nums";//修改购物车列表
        public static final String Action_MoveCollect = "app=cart&act=cart_collect";//购物车移入收藏
        public static final String Action_DelShopCar = "app=cart&act=delete_product";//删除购物车
        public static final String Action_CollectGoods = "app=goods&act=goods_collect";//收藏商品
        public static final String Action_SureOrder = "app=cart&act=confirm_order";//确认订单
        public static final String Action_QueHuoDengJi = "app=goods&act=goods_register";//缺货登记
        public static final String Action_OrderList = "app=order&act=order_list";//订单列表
        public static final String Action_OrderDetail = "app=order&act=order_detail";//订单详情
        public static final String Action_PayType = "app=order&act=payment_method";// 收银台获取支付方式列表（完成）
        public static final String getAction_SumitOrder = "app=cart&act=place_order";// 提交订单
        public static final String Action_PayZhiFuBao = "app=order&act=alipay";// 支付宝
        public static final String Action_StoreList = "app=shop&act=qualification_list";//店铺列表
        public static final String Action_PayZhuangZhang = "app=order&act=order_payment_type";//转账和货到付款
        public static final String Action_UserCenterOther = "app=order&act=statistics_and_settings";//订单统计和客服电话
        public static final String Action_Collect = "app=goods&act=collect_list";//收藏记录
        public static final String Action_Del_Collect = "app=goods&act=delete_collect";//删除收藏
        public static final String Action_NoGoodsList = "app=goods&act=stockout_list";//缺货记录
        public static final String Action_AboutUS = "app=group&act=about_us";//关于我们
        public static final String Action_OrderCancel = "app=order&act=order_cancel";//取消订单
        public static final String Action_isVerified = "app=user&act=is_verified";//是否会员
        public static final String Action_getAppInfo = "app=base&act=app_version";//获取app信息
        public static final String Action_PayWeiXin= "app=order&act=weixin_pay";//微信支付
//http://192.168.70.6/api/index.php?app=message&act=latests&userid=123456&session_id=147c1b2a53012c1b7b61f013dfd63243
     //   http://192.168.70.6/api/index.php?app=region&act=list
    }


    /**
     * 接口名称和参数,参数顺序必须与这里保持一致
     */
    public static HashMap<String, String[]> paramsMap = new HashMap<String, String[]>() {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        {
            //link.type的取值（0-普通产品;1-类型馆;2-整个店铺）;
            //link.id的取值（当link.type为0时取产品的id；为2时,0-潮玩馆;1-时尚馆;2-人文馆；为3时,取值为登录用户的店铺id）。
            //  put(Action.Action_Login, new String[]{"name", "password", "rememberMe"});//是否带token，如果rememberMe=1, 则在登录成功后在Hearder中包含有token

            put(Action.Action_MainData, new String[]{ "pagesize", "size"});//首页
            put(Action.Action_SearchGoods, new String[]{ "pagesize", "size","keyword","catid","order","sort"});//搜索商品
            put(Action.Action_HotSearch, new String[]{ ""});//热门搜索
            put(Action.Action_Category, new String[]{ ""});//
            put(Action.Action_GoodsDetail, new String[]{ "itemid"});//
            put(Action.Action_GoodsSay, new String[]{ "itemid"});//
            put(Action.Action_TradeRecord, new String[]{ "pagesize", "size","itemid"});//
            put(Action.Action_RelatedGoods, new String[]{"itemid"});//
            put(Action.Action_ZhuanQuXiangQing, new String[]{"pagesize", "size","catid"});//
            put(Action.Action_Login, new String[]{"username", "password","captcha","type","registration_id"});//
            put(Action.Action_GetYanZhengMa, new String[]{"mobile", "type"});//1注册，2找回密码，3快速登录
            put(Action.Action_Register, new String[]{"mobile", "password","captcha"});//
            put(Action.Action_ChehckYanZheng, new String[]{"mobile", "captcha"});//
            put(Action.Action_PassReset, new String[]{"mobile", "password","captcha"});//
            put(Action.Action_MessageList, new String[]{"userid", "session_id"});//
            put(Action.Action_MessageDetailList, new String[]{"type", "userid", "session_id", "pagesize", "page"});//消息类型0活动通知 1订单提醒2公告通知
            put(Action.Action_SetMessageRed, new String[]{"type", "userid", "session_id"});//消息类型0活动通知 1订单提醒2公告通知
            put(Action.Action_RegionList, new String[]{""});
            put(Action.Action_SumitZhiZhi, new String[]{"userid","session_id","company_name","areaid","address","consignee","mobile"});
            put(Action.Action_EditZhiZhi, new String[]{"userid","session_id","company_name","areaid","address","consignee","mobile","address_id"});
            put(Action.Action_AddCar, new String[]{"userid","session_id","itemid","number"});
            put(Action.Action_GetCarList, new String[]{"userid","session_id"});
            put(Action.Action_UpdateCarList, new String[]{"userid","session_id","itemid","number"});
            put(Action.Action_MoveCollect, new String[]{"userid","session_id","itemids"});
            put(Action.Action_DelShopCar, new String[]{"userid","session_id","itemids"});
            put(Action.Action_SureOrder, new String[]{"userid","session_id","itemids","type","number"});
            put(Action.Action_QueHuoDengJi, new String[]{"userid","session_id","itemid","number","contact","email","mobile","information"});
            put(Action.Action_OrderList, new String[]{"userid","session_id","status","page","pagesize"});
            put(Action.Action_OrderDetail, new String[]{"userid","session_id","order_id"});
            put(Action.Action_PayType, new String[]{""});
            put(Action.Action_PayZhiFuBao, new String[]{"userid","session_id","order_id"});
            put(Action.getAction_SumitOrder, new String[]{"userid","session_id","itemids","address_id","type","number","note"});
            put(Action.Action_StoreList, new String[]{"userid","session_id","pay_amount"});
            put(Action.Action_PayZhuangZhang, new String[]{"userid","session_id","order_id","payment_id"});//支付ID，3转账支付，4货到付款
            put(Action.Action_UserCenterOther, new String[]{"userid","session_id"});
            put(Action.Action_Collect, new String[]{"userid","session_id"});
            put(Action.Action_Del_Collect, new String[]{"userid","session_id","collectids"});
            put(Action.Action_NoGoodsList, new String[]{"userid","session_id"});
            put(Action.Action_AboutUS, new String[]{"userid","session_id"});
            put(Action.Action_OrderCancel, new String[]{"userid","session_id","order_id"});
            put(Action.Action_CollectGoods, new String[]{"userid","session_id","itemid"});
            put(Action.Action_isVerified, new String[]{"userid","session_id"});
            put(Action.Action_PayWeiXin, new String[]{"userid","session_id","order_id"});
            put(Action.Action_getAppInfo, new String[]{""});
            put(HTML5.Html5_check_order_state, new String[]{"type", "postid"});


        }
    };
    public static class HTML5 {
        //http://m.kuaidi100.com/index_all.html?type=[快递公司编码]&postid=[快递单号]&callbackurl=[点击"返回"跳转的地址]
        public final static String Html5_check_order_state = "http://m.kuaidi100.com/index_all.html?";
    }
    public static String getHtml5UrlFotParameter(String key, String... paramsValue) {
        if (paramsValue.length == 0) { //参数为空的话直接访问
            return key;
        }
        String[] values = Constant.paramsMap.get(key);
        String parameter = "";
        if (values != null) {
            int i = 0;
            for (; i < paramsValue.length; i++) {
                parameter += values[i] + "=" + paramsValue[i] + "&";
            }
        }
        String paramsUrl = key + parameter.substring(0, parameter.length() - 1);
        return  paramsUrl;
    }
    public static String getRootUrl() {
    /*	String rootUrl = AbSharedUtil.getString(AppConfig.getInstance()
                .getApplicationContext(), SystemContext.ROOT_URL_KEY);
		if (!TextUtils.isEmpty(rootUrl)) {
			return rootUrl;
		} else {
			return SystemContext.ROOT_URL_VALUE;
		}*/
        return SystemContext.ROOT_URL_VALUE;
    }
}
